<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        html,body {
            width: 100%;
            height: 100%;
        }
        body {
            /* 添加一个景深方便观察 */
            perspective: 800px;
        }
        ul li {
            list-style: none;
            border: 1px solid #000;
            width: 300px;
            height: 300px;
            font-size: 100px;
            text-align: center;
            line-height: 300px;
            position: absolute;
            left: 0;
            opacity: 0.5;
        }

        ul {
            width: 300px;
            height: 300px;
            /* border: 1px solid #000; */
            position: fixed;
            top: 0;
            left: 0;
            bottom: 0;
            right: 0;
            margin: auto;
            /* 设置元素的3D空间 */
            transform-style: preserve-3d;
            /* animation: a 2s linear forwards; */
            /* transform: rotateX(45deg) rotateY(45deg) rotateZ(45deg); */
            animation: move 6s linear 14s infinite;
        }

        @keyframes a {
            to {
                transform: rotateX(45deg) rotateY(45deg) rotateZ(45deg);
            }
        }

        @keyframes move {
           0%{
            transform: rotateY(0)
           }
           100%{
            transform: rotateY(360deg);
           }
        }

        ul li:nth-child(1){
            /* rotateX 表示以X轴进行旋转 */
            /* transform: rotateX(90deg) translateZ(-150px); */
            background-color: green;
            animation: a1 2s linear 2s forwards;
        }

        @keyframes a1 {
            to {
                transform: rotateX(90deg) translateZ(-150px);
            }
        }

        ul li:nth-child(2){
            /* transform: rotateX(90deg) translateZ(150px); */
            animation: a2 2s linear 4s forwards;
            background-color: red;
        }
        @keyframes a2 {
            to {
                transform: rotateX(90deg) translateZ(150px);
            }
        }

        ul li:nth-child(3){
              /* rotateY 表示以Y轴进行旋转 */
            /* transform: rotateY(90deg) translateZ(-150px); */
            background-color: saddlebrown;
            animation: a3 2s linear 6s forwards;
        }
        @keyframes a3 {
            to {
                transform: rotateY(90deg) translateZ(-150px);
            }
        }

        ul li:nth-child(4){
            /* transform: rotateY(90deg) translateZ(150px); */
            background-color: skyblue;
            animation: a4 2s linear 8s forwards;
        }
        @keyframes a4 {
            to {
                transform: rotateY(90deg) translateZ(150px);
            }
        }
        ul li:nth-child(5){
            /* transform: translateZ(-150px); */
            background-color: yellow;
            animation: a5 2s linear 10s forwards;
        }
        @keyframes a5 {
            to {
                transform: translateZ(-150px);
            }
        }
        ul li:nth-child(6){
            /* transform: translateZ(150px); */
            background-color: purple;
            animation: a6 2s linear 12s forwards;
        }
        @keyframes a6 {
            to {
                transform: translateZ(150px);
            }
        }
    
    </style>
</head>
<body>
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
        <li>6</li>
    </ul>
</body>
</html>